<?php require_once('../../Connections/conexion.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "MM_insert")) {
  $insertSQL = sprintf("INSERT INTO ope_cam (Id_OpeCam, Nom_OpeCam) VALUES (%s, %s)",
                       GetSQLValueString($_POST['Cod_banco'], "int"),
                       GetSQLValueString($_POST['Nom_banco'], "text"));

  mysql_select_db($database_conexion, $conexion);
  $Result1 = mysql_query($insertSQL, $conexion) or die(mysql_error());
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta content="text/html; charset=ISO-8859-1"
     http-equiv="content-type" />
  <title>Agregar o Modificar Operadores Cambiarios</title>
 <link href="css/Ope_cambiario.css" rel="stylesheet" type="text/css" />
 </head>
  <body>
  
  <div id="cabezera"> 
   <h1>Logo</h1>   
   <div id="menu"> 
   <p> Menu </p> </div>
  </div>
   <div id="contenido"> 
  <div id="Titulo">Adicionar Operador Cambiario
   
     
    
    <form name="hola" method="POST" action="<?php echo $editFormAction; ?>">
      <div id="Informacion Operador Cambiario">
        <div id="tabla1"> Numero de Identidicaci&oacute;n</div>
        <div id="caja de texto">
          <input name="Cod_banco" maxlength="4" type="text" />
        </div>
        <div class="nofloat"></div>
        <div id="tabla2">Nombre Entidad Bancaria </div>
        <div id="caja de texto2">
          <input name="Nom_banco" type="text" />
        </div>
        <p>&nbsp;</p>
        <p>
          <input type="submit" name="Guardar" id="Guardar" value="Guardar"  />
        </p>
      </div>
      <input type="hidden" name="MM_insert" value="MM_insert" />
    </form>
    <p>&nbsp;</p>
<div class="nofloat">
     <p>&nbsp;</p>
       <p>&nbsp;</p>
     </div>
    </div>
  </div>
  <p>&nbsp;</p>
</body>
</html>
   